<?php
/**
 * 
 * IndexAction.class.php (前台首页)
 *
 * @package      	YOURPHP
 * @author          liuxun QQ:147613338 <admin@yourphp.cn>
 * @copyright     	Copyright (c) 2008-2011  (http://www.yourphp.cn)
 * @license         http://www.yourphp.cn/license.txt
 * @version        	YourPHP企业网站管理系统 v2.1 2011-03-01 yourphp.cn $
 */
if(!defined("Yourphp")) exit("Access Denied");
class FeedbackAction extends BaseAction {

    function _initialize() {
        parent::_initialize();
    }

    public function addfeed() {
        $data['description'] = $_POST['description'];
        $data['content'] = $_POST['content'];
        $data['createtime'] = time();
        $abc = M('feedback')->add($data);
        if ($abc) {
            echo json_encode(array('code' => 1, 'msg' => '添加成功'));
            exit;
        } else {
            echo json_encode(array('code' => 0, 'msg' => '添加失败'));
            exit;
        }
    }
    
    public function join(){
        $this->display() ;
    }
    
    public function savejoin() {
        $verifyCode = trim($_POST['verifyCode']);
        if (md5($verifyCode) != $_SESSION['verify']) {
            $this->error('请正确输入验证码');
        }
        $_POST['createtime'] = time();
        $info = M('guestbook')->add($_POST);
        if ($info) {
            $this->success('添加成功');
        } else {
            $this->error('添加失败');
        }
    }

}

?>